﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Decorate
{
    public class Soy : CondimentDecorator
    {
        Beverage beverage;

        public Soy(Beverage beverage)
        {
            // 在这个对象里，把beverage指向直接包装
            // 的beverage对象
            this.beverage = beverage;
        }

        public override Beverage.Size getSize()
        {
            return beverage.getSize();
        }

        public override String getDescription()
        {
            // 返回指向对象的描述 + Soy
            return beverage.getDescription() + ", Soy";
        }

        public override double cost()
        {
            // 返回指向对象的花费 + Soy的花费
            double dRtn = 0.0;

            switch (this.size)
            {
                case Size.tall: dRtn = beverage.cost() + 0.1; break;
                case Size.grande: dRtn = beverage.cost() + 0.15; break;
                case Size.venti: dRtn = beverage.cost() + 0.2; break;
            }


            return dRtn;
        }
    }
}
